package com.mvvm.ktnet.http

import com.mvvm.ktnet.http.base.IBaseResponse
import com.squareup.moshi.JsonClass

/**
 *
 * @ProjectName:    KtNet
 * @Package:        com.mvvm.ktnet.http
 * @ClassName:      BaseEntity
 * @Description:     java类作用描述
 * @Author:         Alex
 * @CreateDate:     2020/11/12 9:51
 * @UpdateUser:     更新者：
 * @UpdateDate:     2020/11/12 9:51
 * @UpdateRemark:   更新说明：
 * @Version:        1.0
 */
@JsonClass(generateAdapter = true)
data class BaseEntity<T>(
    var data: T? = null,
    var code: Int?,
    var msg: String?
) : IBaseResponse<T> {
    override fun code() = code

    override fun msg() = msg

    override fun data() = data

    override fun success() = code == 1
}